package com.koro.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.math.BigDecimal;

@ApiModel
@Data
@Document(indexName = "es_goods")
public class SaveGoodsDTO {

    @Id
    @ApiModelProperty(value = "ID")
    private Integer id;

    @Field(analyzer = "ik_max_word", type = FieldType.Text)
    @ApiModelProperty(value = "商品名称")
    private String goodsName;

    @ApiModelProperty(value = "商品价格")
    private BigDecimal price;

    @ApiModelProperty(value = "库存")
    private Integer stock;
}
